package com.zzk.lanouhn.myapplication1.adapters;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import java.util.List;

/**
 * Created by lanouhn on 16/8/23.
 */
public class InvestViewAdapter extends FragmentStatePagerAdapter {
    private List<String> tabName;
    private List<Fragment> fragments;

    public InvestViewAdapter(FragmentManager fm, List<String> tabName, List<Fragment> fragments) {
        super(fm);
        this.tabName = tabName;
        this.fragments = fragments;
    }



    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return tabName.get(position);
    }
}
